package com.atmc.controller;

import com.atmc.entity.ResponseResult;
import com.atmc.entity.WishForm;
import com.atmc.service.WishFormService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @BelongsProject: SpringCloud1216
 * @BelongsPackage: com.atmc.controller
 * @Author: chuyings
 * @CreateTime: 2022-11-17  13:45
 * @Version: 1.0
 */
@RestController
@CrossOrigin
public class WishFormController {
    @Autowired
    WishFormService wishFormService;

    //提交意愿领养清单
    @RequestMapping("/commitWishForm")
    public ResponseResult commitWishForm(@RequestBody WishForm wishForm){

        return wishFormService.commitWishForm(wishForm);
    }
    //渲染我的领养记录
    @RequestMapping("/petAdoptionRecord")
    public List<WishForm> getPetAdoptionRecord(@RequestBody WishForm wishForm){
        return wishFormService.getPetAdoptionRecord(wishForm);
    }
}
